package com.yuan.controller;

import com.yuan.bean.Car;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

@RestController //控制器类 + 自动转换字符或JSON
public class MyController {
    //访问前缀名
    @RequestMapping("/test")
    String test() {
        //返回值
        return "Hello,Spring Boot 2";
    }

    //自动装配
    @Autowired
    Car car;


    //访问前缀名
    @RequestMapping("/test3")
    Car select() {
        //返回对象
        return car;
    }


}
